<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>test: TEST/Worker.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">test
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.7 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_60f03a562a2e326bd289c232b1b46d6c.html">TEST</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Worker.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_worker_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* COPYRIGHT NOTICE</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright (c) 2014 MPIG</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#ifndef _WORKER_H_</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#define _WORKER_H_</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">//#pragma once</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include  &lt;string&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include  &quot;<a class="code" href="_person_8h.html">person.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="class_worker.html">   34</a></span>&#160;<span class="keyword">class  </span><a class="code" href="class_worker.html">Worker</a> : <span class="keyword">virtual</span> <span class="keyword">public</span> <a class="code" href="class_person.html">Person</a></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;{   </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <span class="keywordtype">char</span>  *Department;      </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordtype">char</span>  *Job;             </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keywordtype">void</span>  Init(<span class="keywordtype">char</span>*, <span class="keywordtype">char</span>*);           <span class="comment">//辅助函数用于初始化数据成员</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_worker.html#a3754817df06ffe220f7f0d903c78ccac">   51</a></span>&#160;    <a class="code" href="class_worker.html#a3754817df06ffe220f7f0d903c78ccac">Worker</a>()    {Init(0, 0); }          <span class="comment">//默认构造函数</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <a class="code" href="class_worker.html">Worker</a>(<span class="keywordtype">char</span>*, <span class="keywordtype">int</span>, <span class="keywordtype">char</span>, <span class="keywordtype">char</span>*, <span class="keywordtype">char</span>*); <span class="comment">//构造函数</span></div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <a class="code" href="class_worker.html">Worker</a>(<a class="code" href="class_worker.html">Worker</a> &amp;w)                   <span class="comment">//拷贝构造函数</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    {Init(w.Department, w.Job);}        </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    <a class="code" href="class_worker.html">Worker</a>(<span class="keywordtype">char</span> *d, <span class="keywordtype">char</span> *j)            <span class="comment">//重载的构造函数</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    { Init(d, j); }     </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="class_worker.html#aa8e4543ef1e93fd9d884269ba30c5bfe">   61</a></span>&#160;    <a class="code" href="class_worker.html#aa8e4543ef1e93fd9d884269ba30c5bfe">~Worker</a>()                           <span class="comment">//析构函数</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    {   <span class="keyword">delete</span> Department;  <span class="keyword">delete</span> Job; }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keywordtype">void</span>  SetDep(<span class="keywordtype">char</span>*);                <span class="comment">//设置部门</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordtype">void</span>  SetJob(<span class="keywordtype">char</span>*);                <span class="comment">//设置工作</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">char</span>  *GetDep(<span class="keywordtype">char</span>*);               <span class="comment">//获取部门</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <span class="keywordtype">char</span>  *GetJob(<span class="keywordtype">char</span>*);               <span class="comment">//获取工作</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;};</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="_person_8h_html"><div class="ttname"><a href="_person_8h.html">Person.h</a></div><div class="ttdoc">该文件定义了一个普通人的类 </div></div>
<div class="ttc" id="class_worker_html_aa8e4543ef1e93fd9d884269ba30c5bfe"><div class="ttname"><a href="class_worker.html#aa8e4543ef1e93fd9d884269ba30c5bfe">Worker::~Worker</a></div><div class="ttdeci">~Worker()</div><div class="ttdef"><b>Definition:</b> Worker.h:61</div></div>
<div class="ttc" id="class_worker_html_a3754817df06ffe220f7f0d903c78ccac"><div class="ttname"><a href="class_worker.html#a3754817df06ffe220f7f0d903c78ccac">Worker::Worker</a></div><div class="ttdeci">Worker()</div><div class="ttdef"><b>Definition:</b> Worker.h:51</div></div>
<div class="ttc" id="class_person_html"><div class="ttname"><a href="class_person.html">Person</a></div><div class="ttdoc">提供一个基类 </div><div class="ttdef"><b>Definition:</b> Person.h:34</div></div>
<div class="ttc" id="class_worker_html"><div class="ttname"><a href="class_worker.html">Worker</a></div><div class="ttdoc">这是一个工人类，继承于person </div><div class="ttdef"><b>Definition:</b> Worker.h:34</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2014年 十二月 29日 星期一 19:28:15 , 为 test使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>
